package com.itheima.Service;

import com.itheima.mapper.EmpMapper;
import com.itheima.pojo.Emp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class EmpService {
    @Autowired
    private EmpMapper empMapper;

    public Emp queryById(int id){
        return empMapper.selectByPrimaryKey(id);
    }

    @Transactional
    public Integer saveUser(Emp emp){
        // 新增
        return empMapper.insertSelective(emp);
    }
}
